/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tongxunlu;

import java.util.ArrayList;
import java.util.Iterator;

/**
 *
 * @author Tim
 */
public class Operation {
    public static boolean find(ArrayList<person> al, person c) {
        Iterator it = al.iterator();
        while (it.hasNext()) {
            person cs = (person) it.next();
            if (cs.equels(c)) {
                return true;
            }
        }
        return false;
    }
    public static boolean add(ArrayList<person>al,person c){
        if(find(al,c))return false;
        else {al.add(c);return true;}
    }
    public static boolean dele(ArrayList<person>al,person c){
       return al.remove(c);
    }
}
